.class public Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;
.super Landroid/widget/BaseAdapter;
.source "CommentDetailAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentLongClickListener;,
        Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentClickListener;,
        Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;
    }
.end annotation


# instance fields
.field private mAvatarOptions:Lcom/nostra13/universalimageloader/core/DisplayImageOptions;

.field private mComments:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/CommentModel;",
            ">;"
        }
    .end annotation
.end field

.field private mContext:Landroid/content/Context;

.field private mImageLoader:Lcom/nostra13/universalimageloader/core/ImageLoader;

.field private mOnCommentClickListener:Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentClickListener;

.field private mOnCommentLongClickListener:Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentLongClickListener;

.field private mUserModel:Lcom/brixd/niceapp/model/UserModel;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .registers 6
    .param p1, "context"    # Landroid/content/Context;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/CommentModel;",
            ">;)V"
        }
    .end annotation

    .prologue
    .local p2, "comments":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/CommentModel;>;"
    const v2, 0x7f02010e

    const/4 v1, 0x1

    .line 42
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 43
    iput-object p1, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mContext:Landroid/content/Context;

    .line 44
    iput-object p2, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mComments:Ljava/util/List;

    .line 45
    invoke-static {}, Lcom/brixd/niceapp/service/UserService;->getLoginUser()Lcom/brixd/niceapp/model/UserModel;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mUserModel:Lcom/brixd/niceapp/model/UserModel;

    .line 47
    invoke-static {}, Lcom/nostra13/universalimageloader/core/ImageLoader;->getInstance()Lcom/nostra13/universalimageloader/core/ImageLoader;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mImageLoader:Lcom/nostra13/universalimageloader/core/ImageLoader;

    .line 48
    new-instance v0, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    invoke-direct {v0}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;-><init>()V

    .line 49
    invoke-virtual {v0, v1}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->resetViewBeforeLoading(Z)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->cacheInMemory(Z)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    .line 50
    invoke-virtual {v0, v1}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->cacheOnDisc(Z)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    sget-object v1, Lcom/nostra13/universalimageloader/core/assist/ImageScaleType;->EXACTLY:Lcom/nostra13/universalimageloader/core/assist/ImageScaleType;

    invoke-virtual {v0, v1}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->imageScaleType(Lcom/nostra13/universalimageloader/core/assist/ImageScaleType;)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    sget-object v1, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    .line 51
    invoke-virtual {v0, v1}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->bitmapConfig(Landroid/graphics/Bitmap$Config;)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    new-instance v1, Lcom/nostra13/universalimageloader/core/display/SimpleBitmapDisplayer;

    invoke-direct {v1}, Lcom/nostra13/universalimageloader/core/display/SimpleBitmapDisplayer;-><init>()V

    .line 52
    invoke-virtual {v0, v1}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->displayer(Lcom/nostra13/universalimageloader/core/display/BitmapDisplayer;)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    .line 53
    invoke-virtual {v0, v2}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->showImageOnFail(I)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    .line 54
    invoke-virtual {v0, v2}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->showImageOnLoading(I)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    .line 55
    invoke-virtual {v0, v2}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->showImageForEmptyUri(I)Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;

    move-result-object v0

    invoke-virtual {v0}, Lcom/nostra13/universalimageloader/core/DisplayImageOptions$Builder;->build()Lcom/nostra13/universalimageloader/core/DisplayImageOptions;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mAvatarOptions:Lcom/nostra13/universalimageloader/core/DisplayImageOptions;

    .line 56
    return-void
.end method

.method static synthetic access$000(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;)Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentClickListener;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;

    .prologue
    .line 29
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mOnCommentClickListener:Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentClickListener;

    return-object v0
.end method

.method static synthetic access$100(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;)Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentLongClickListener;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;

    .prologue
    .line 29
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mOnCommentLongClickListener:Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentLongClickListener;

    return-object v0
.end method

.method static synthetic access$200(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;)Lcom/brixd/niceapp/model/UserModel;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;

    .prologue
    .line 29
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mUserModel:Lcom/brixd/niceapp/model/UserModel;

    return-object v0
.end method

.method static synthetic access$300(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;)Landroid/content/Context;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;

    .prologue
    .line 29
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mContext:Landroid/content/Context;

    return-object v0
.end method


# virtual methods
.method public getCount()I
    .registers 2

    .prologue
    .line 60
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mComments:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .registers 3
    .param p1, "position"    # I

    .prologue
    .line 65
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mComments:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .registers 4
    .param p1, "position"    # I

    .prologue
    .line 70
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .registers 10
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    .line 76
    if-nez p2, :cond_c0

    .line 77
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mContext:Landroid/content/Context;

    const v3, 0x7f030031

    const/4 v4, 0x0

    invoke-static {v2, v3, v4}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 78
    new-instance v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;

    invoke-direct {v1, p0}, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;-><init>(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;)V

    .line 79
    .local v1, "holder":Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;
    iput-object p2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->containerView:Landroid/view/View;

    .line 80
    const v2, 0x7f0a00bb

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->authorAvatar:Landroid/widget/ImageView;

    .line 81
    const v2, 0x7f0a00bc

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->author:Landroid/widget/TextView;

    .line 82
    const v2, 0x7f0a00d5

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->content:Landroid/widget/TextView;

    .line 83
    const v2, 0x7f0a00d6

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->timeCreated:Landroid/widget/TextView;

    .line 84
    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 89
    :goto_42
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mComments:Ljava/util/List;

    invoke-interface {v2, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/brixd/niceapp/model/CommentModel;

    .line 90
    .local v0, "comment":Lcom/brixd/niceapp/model/CommentModel;
    iget-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->author:Landroid/widget/TextView;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0}, Lcom/brixd/niceapp/model/CommentModel;->getAuthorUser()Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v4

    invoke-virtual {v4}, Lcom/brixd/niceapp/model/CommonUserModel;->getUserName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " @ "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v0}, Lcom/brixd/niceapp/model/CommentModel;->getReplayToUser()Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v4

    invoke-virtual {v4}, Lcom/brixd/niceapp/model/CommonUserModel;->getUserName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 91
    iget-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->content:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/brixd/niceapp/model/CommentModel;->getContent()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 92
    iget-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->timeCreated:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/brixd/niceapp/model/CommentModel;->getCreatedAt()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/brixd/niceapp/util/DateUtils;->convertServerTimeToLocal(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 94
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mImageLoader:Lcom/nostra13/universalimageloader/core/ImageLoader;

    invoke-virtual {v0}, Lcom/brixd/niceapp/model/CommentModel;->getAuthorUser()Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v3

    invoke-virtual {v3}, Lcom/brixd/niceapp/model/CommonUserModel;->getAvatarUrl()Ljava/lang/String;

    move-result-object v3

    iget-object v4, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->authorAvatar:Landroid/widget/ImageView;

    iget-object v5, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mAvatarOptions:Lcom/nostra13/universalimageloader/core/DisplayImageOptions;

    invoke-virtual {v2, v3, v4, v5}, Lcom/nostra13/universalimageloader/core/ImageLoader;->displayImage(Ljava/lang/String;Landroid/widget/ImageView;Lcom/nostra13/universalimageloader/core/DisplayImageOptions;)V

    .line 96
    iget-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->containerView:Landroid/view/View;

    new-instance v3, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$1;

    invoke-direct {v3, p0, v0}, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$1;-><init>(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;Lcom/brixd/niceapp/model/CommentModel;)V

    invoke-virtual {v2, v3}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 106
    iget-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->containerView:Landroid/view/View;

    new-instance v3, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$2;

    invoke-direct {v3, p0, v0}, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$2;-><init>(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;Lcom/brixd/niceapp/model/CommentModel;)V

    invoke-virtual {v2, v3}, Landroid/view/View;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    .line 118
    iget-object v2, v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;->authorAvatar:Landroid/widget/ImageView;

    new-instance v3, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$3;

    invoke-direct {v3, p0, v0}, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$3;-><init>(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;Lcom/brixd/niceapp/model/CommentModel;)V

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 134
    return-object p2

    .line 86
    .end local v0    # "comment":Lcom/brixd/niceapp/model/CommentModel;
    .end local v1    # "holder":Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;
    :cond_c0
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;

    .restart local v1    # "holder":Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$ViewHolder;
    goto/16 :goto_42
.end method

.method public setOnCommentClickListener(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentClickListener;)V
    .registers 2
    .param p1, "listener"    # Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentClickListener;

    .prologue
    .line 148
    iput-object p1, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mOnCommentClickListener:Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentClickListener;

    .line 149
    return-void
.end method

.method public setOnCommentLongClickListener(Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentLongClickListener;)V
    .registers 2
    .param p1, "listener"    # Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentLongClickListener;

    .prologue
    .line 152
    iput-object p1, p0, Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter;->mOnCommentLongClickListener:Lcom/brixd/niceapp/activity/fragment/adapter/CommentDetailAdapter$OnCommentLongClickListener;

    .line 153
    return-void
.end method
